import http from '/@lib/utils/http/request'
import { ClientForm, ClientQuery, ClientVO } from '/@/api/system/client/types'

export const ApiSysClient: any = {}

/**
 * 查询客户端管理列表
 */
ApiSysClient.page = (queryParam?: ClientQuery): Promise<PageResult<ClientVO[]>> => {
  return http.get('/sysClient/page', queryParam)
}

/**
 * 查询客户端管理详细
 * @param id
 */
ApiSysClient.getInfo = (id: string | number): Promise<ClientVO> => {
  return http.get('/sysClient/getInfo/' + id)
}

/**
 * 新增客户端管理
 * @param data
 */
ApiSysClient.save = (data: ClientForm) => {
  return http.post('/sysClient/save', data)
}

/**
 * 修改客户端管理
 * @param data
 */
ApiSysClient.update = (data: ClientForm) => {
  return http.post('/sysClient/update', data)
}

/**
 * 删除客户端管理
 * @param id
 */
ApiSysClient.remove = (id: string | number) => {
  return http.post('/sysClient/remove/' + id)
}

/**
 * 状态修改
 * @param id ID
 * @param status 状态
 */
ApiSysClient.changeStatus = (id: number | string, status: string) => {
  const data = {
    id,
    status
  }
  return http.post('/sysClient/changeStatus', data)
}
